feat(api): make function call output call IDs optional - #539
Conversation
Castiron custom codeMixed files: 47 → 50 3 newly customized · 0 customizations removed · 0 existing customizations changed · 6 generated baselines changed Compared
44 existing customizations unchanged
4 more in the full report. A changed generated baseline means this report cannot reliably identify which handwritten lines changed. Inspect the custom-code diffDownload the exact patch produced by this run (requires repository access): gh run download 33082176846 --repo openai/openai-ruby \
--name castiron-custom-code-33082176846-1 --dir /tmp/castiron-custom-code-33082176846-1
git apply --stat /tmp/castiron-custom-code-33082176846-1/custom-code.patch
cat /tmp/castiron-custom-code-33082176846-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin 53ccf39b464d8b2052456fa78aaea4dcdee8158c ecbd49b67154aa0a90709dec5bd0d1f87bf20fa6
python3 scripts/castiron/custom_code_report.py report \
--base 53ccf39b464d8b2052456fa78aaea4dcdee8158c \
--head ecbd49b67154aa0a90709dec5bd0d1f87bf20fa6 --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-ecbd49b67154
cat /tmp/castiron-custom-code-ecbd49b67154/custom-code.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
jbeckwith-oai
left a comment
There was a problem hiding this comment.
The newly optional output call_id is correctly omitted at runtime, but the generated public Sorbet/RBS to_hash contracts still guarantee a required non-null call_id. Update the stable and beta generated hash shapes to accurately model omission and add a focused omitted-output regression.
| output: OpenAI::Responses::ResponseFunctionToolCallOutputItem::Output::Variants, | ||
| status: OpenAI::Responses::ResponseFunctionToolCallOutputItem::Status::TaggedSymbol, | ||
| type: Symbol, | ||
| call_id: String, |
There was a problem hiding this comment.
[P2] Make the generated output hash contract reflect omitted call_id
This PR makes response-output call_id optional, and BaseModel skips an absent optional field when populating @data; to_hash returns that data without a :call_id entry. However, this changed RBI still declares the returned hash has a required call_id: String, and the matching RBS and beta signatures make the same promise. Consequently model.to_hash.fetch(:call_id) type-checks but raises KeyError for the newly supported valid response. Generate an accurately optional hash key (and matching RBS/beta contracts) and add a focused regression for an output with no call ID.
There was a problem hiding this comment.
hmm this looks like a longstanding issue with the generated RBI code will add a backlog issue for this
There was a problem hiding this comment.
Castiron-Internal-PR: openai/openai-ruby-internal#56 Castiron-Source-SHA: a2a75208f6680794a34b23543689d7bf883f04c9 Castiron-Public-Base-SHA: 53ccf39
2ba4595 to
ecbd49b
Compare
Summary
Align function call output types with the API schema:
call_idis optional in stable and beta input and response types, and input types also acceptnull.